home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qaccel.h.z / qaccel.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  2.0 KB  |  92 lines

  1. /****************************************************************************
  2. ** $Id: qaccel.h,v 2.8 1998/07/03 00:09:29 hanord Exp $
  3. **
  4. ** Definition of QAccel class
  5. **
  6. ** Created : 950419
  7. **
  8. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  9. **
  10. ** This file is part of Qt Free Edition, version 1.40.
  11. **
  12. ** See the file LICENSE included in the distribution for the usage
  13. ** and distribution terms, or http://www.troll.no/free-license.html.
  14. **
  15. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  16. ** your own programs or libraries.
  17. **
  18. ** Please see http://www.troll.no/pricing.html for information about 
  19. ** Qt Professional Edition, which is this same library but with a
  20. ** license which allows creation of commercial/proprietary software.
  21. **
  22. *****************************************************************************/
  23.  
  24. #ifndef QACCEL_H
  25. #define QACCEL_H
  26.  
  27. #ifndef QT_H
  28. #include "qobject.h"
  29. #include "qkeycode.h"
  30. #endif // QT_H
  31.  
  32.  
  33. class QAccelList;                // internal class
  34.  
  35.  
  36. class QAccel : public QObject            // accelerator class
  37. {
  38.     Q_OBJECT
  39. public:
  40.     QAccel( QWidget *parent, const char *name=0 );
  41.    ~QAccel();
  42.  
  43.     bool    isEnabled() const;
  44.     void    setEnabled( bool );
  45.  
  46.     uint    count() const;
  47.  
  48.     int        insertItem( int key, int id=-1 );
  49.     void    removeItem( int id );
  50.     void    clear();
  51.  
  52.     int        key( int id );
  53.     int        findKey( int key ) const;
  54.  
  55.     bool    isItemEnabled( int id )     const;
  56.     void    setItemEnabled( int id, bool enable );
  57.  
  58.     bool    connectItem( int id,
  59.                  const QObject *receiver, const char *member );
  60.     bool    disconnectItem( int id,
  61.                 const QObject *receiver, const char *member );
  62.  
  63.     void    repairEventFilter();
  64.  
  65. signals:
  66.     void    activated( int id );
  67.  
  68. protected:
  69.     bool    eventFilter( QObject *, QEvent * );
  70.  
  71. private slots:
  72.     void    tlwDestroyed();
  73.  
  74. private:
  75.     QAccelList *aitems;
  76.     bool    enabled;
  77.     QWidget    *tlw;
  78.  
  79. private:    // Disabled copy constructor and operator=
  80.     QAccel( const QAccel & );
  81.     QAccel &operator=( const QAccel & );
  82. };
  83.  
  84.  
  85. inline bool QAccel::isEnabled() const
  86. {
  87.     return enabled;
  88. }
  89.  
  90.  
  91. #endif // QACCEL_H
  92.